package webmarket.model;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.ThreadContext;
import org.apache.logging.log4j.ThreadContext.ContextStack;
import org.apache.logging.log4j.message.Message;


/**
 * The persistent class for the log database table.
 * 
 */
@Entity
@Table(name="log")
@NamedQuery(name="ReadLog.findAll", query="SELECT r FROM ReadLog r")
public class ReadLog implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int id;

	@Column(name="CONTEXTMAP")
	private Map<String, String> contextmap;

	@Column(name="CONTEXTSTACK")
	private ThreadContext.ContextStack contextstack;

	@Column(name="FQCN")
	private String fqcn;

	@Column(name="LEVEL")
	private String level;

	@Column(name="LOGGERNAME")
	private String loggername;

	@Column(name="MARKER")
	private Marker marker;

	@Column(name="MESSAGE")
	private Message message;

	@Column(name="MILLIS")
	private BigInteger millis;

	@Column(name="SOURCE")
	private StackTraceElement source;

	@Column(name="THREADNAME")
	private String threadname;

	@Column(name="THROWN")
	private Throwable thrown;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="userid")
	private User user;

	public ReadLog() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Object getContextmap() {
		return this.contextmap;
	}

	public void setContextmap(Map<String, String> contextmap) {
		this.contextmap = contextmap;
	}

	public Object getContextstack() {
		return this.contextstack;
	}

	public void setContextstack(ContextStack contextstack) {
		this.contextstack = contextstack;
	}

	public String getFqcn() {
		return this.fqcn;
	}

	public void setFqcn(String fqcn) {
		this.fqcn = fqcn;
	}

	public String getLevel() {
		return this.level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public String getLoggername() {
		return this.loggername;
	}

	public void setLoggername(String loggername) {
		this.loggername = loggername;
	}

	public Object getMarker() {
		return this.marker;
	}

	public void setMarker(Marker marker) {
		this.marker = marker;
	}

	public Object getMessage() {
		return this.message;
	}

	public void setMessage(Message message) {
		this.message = message;
	}

	public BigInteger getMillis() {
		return this.millis;
	}

	public void setMillis(BigInteger millis) {
		this.millis = millis;
	}

	public Object getSource() {
		return this.source;
	}

	public void setSource(StackTraceElement source) {
		this.source = source;
	}

	public String getThreadname() {
		return this.threadname;
	}

	public void setThreadname(String threadname) {
		this.threadname = threadname;
	}

	public Object getThrown() {
		return this.thrown;
	}

	public void setThrown(Throwable thrown) {
		this.thrown = thrown;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}